Method and apparatus for artifically intelligent model-based control of dynamic processes using probabilistic agents

ABSTRACT

A system and method for controlling a process such as an oil production process is disclosed. The system comprises multiple intelligent agents for processing data received from a plurality sensors deployed in a job site of an oil well, and applies a probabilistic model for evaluating risk and recommending appropriate control action to the process.

CROSS-REFERENCE TO RELATED APPLICATION

This application is a continuation of U.S. patent application Ser. No.14/092,803, filed Nov. 27, 2013, the content of which is incorporated byreference herein in its entirety.

FIELD

Embodiments taught herein relate generally to methods and apparatus forcontrolling complex equipment and dynamic processes and, moreparticularly, to methods and apparatus for controlling said equipmentand processes with greater certainty for decision making during thecontrolling hereof.

BACKGROUND

Complex industrial equipment is often critical to production operationswith significant upstream and downstream effects in the event ofperformance losses or equipment failure. Sensor and equipment failures,sensor calibration drift, varying process parameters and changes ordisturbances in operating conditions or environment can all contributeto production problems and losses.

The fusion of sensors, equipment and dynamic processes, some of whichcannot be measured cost effectively or at all, make it very difficultfor production operations to identify, let alone remediate equipment andproduction problems. As a consequence, many companies require skilledoperators or contractors to observe and identify problems and determinewhich actions or solutions to implement. Often sufficient information isnot available on a timely basis, however decisions are still required.

Traditionally advanced control systems use defined models of processesto correct for process variations or disturbances. It can often bedifficult, or not possible at all, to accurately determine, anticipateor identify the causality of variations or disturbances. Determining thebest possible course of action under these circumstances is even moredifficult especially when control action based on incorrect diagnosiscan place the process or the product at risk.

As taught by Ken Schwaber and Mike Beedle in Agile Software Developmentwith Scrum, (2002) Upper Saddle River: Prentice Hall, p. 25, ISBN0-13-067634-9, retrieved Jul. 6, 2007:

-   -   “The defined process control model requires that every piece of        work be completely understood. Given a well-defined set of        inputs, the same outputs are generated every time. A defined        process can be started and allowed to run until completion, with        the same results every time.”        http://en.wikipedia.org/wiki/Defined_process-cite_note-1

Model predictive control techniques typically require the nature ofdisturbances to be known in advance in order to provide controldirection to bring the process back within its normal operatingenvelope. Such techniques also require the parameters of the model to beaccurately tuned such that inputs to the model generate accurate andrelevant outputs. Such applications require significant upkeep by highlyskilled and knowledgeable individuals unless they are highly stable.

Such advanced control techniques are typically addressed with anexhaustive set of logical or knowledge based rules to try and identifywith certainty what the cause is and the best course of action toimplement. Multiple contributions to an observable problem can createsufficient uncertainty that these systems cannot perform or there aresimply too many variations to exhaustively catalog. In addition, thecomputational requirements to diagnose and determine appropriatecorrective action can interfere with the performance of time sensitiveprocess monitoring and control.

Addressing these issues requires a hardware and software platformcapable of identifying and prioritizing real time control actions whileexecuting advanced Artificial Intelligence (AI) methods that enablediagnostics and decision making in uncertain conditions.

Pattern recognition is a common feature in artificial intelligence andmachine learning applications. In general it is used to assign a labelor classification to a given input value by performing “most likely”matching of the inputs, taking into account their statistical variation.It is often confused with pattern matching which looks for exact matchesin the data input with pre-existing pattern(s) such as is taught in U.S.Pat. No. 7,818,276 Veillette.

Pattern recognition is a technique typically devoid of a trueunderstanding of the physical data. Relying solely on patternrecognition to classify a variation or a disturbance to a process forthe basis of a control action is akin to taking a blind risk.

There is a need for apparatus and methods for controlling dynamicprocesses such that sufficient confidence and certainty in the processstate exists so that automated control action can be taken withacceptable levels of risk.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a flowchart illustrating an embodiment of a hierarchicalstructure of an Intelligent Agent (IA) network having several types ofintelligent agents for control and optimization of an apparatus andprocess, in the context of a sucker rod pump controller for oil wells,more particularly and presented in a larger format, FIG. 1-1 illustratesthe Status Agent, the AI Manager, and the Diagnostic Agent(s) while FIG.1-2 illustrates the Data & Modeling Agent, the Optimization Agent(s) andthe Control Strategy Agent(s);

FIG. 2 is a functional diagram of a Status Agent illustrating theinteraction of a Status Agent (of FIG. 2-2) with the Data and ModellingAgent, Diagnostic Agents (FIG. 2-1) and a Parameter Tuning Agent (FIG.2-2), in an embodiment according to FIG. 1;

FIG. 3 is a timing diagram for an implementation with a cyclic pumpingprocess wherein the supervisory agent is monitoring the streamed datafrom the process at time increments (FIG. 3-1) intermediate a cycle andperforming testing, probabilistic classification for recruitingappropriate Control Agents as necessary, learning and updating agents(FIG. 3-2) and further monitoring the cycle as a whole (FIGS. 3-2 and3-3) classifying the results on a probabilistic basis to intelligentlycontrol the cycle and manage deviations;

FIG. 4 is a flowchart illustrating prioritization and triggering ofDiagnostic Agents by an AI Manager (FIG. 4-1) and based on real timeobservations and triggers from a Data & Modeling Agent (FIG. 4-2), theStatus Agent (FIG. 4-1) conducting probabilistic analysis to determinethe causality of deviation, prioritizing and selecting likely diagnosticagents based on process parameters, learning from solutions, updatingmodels and issuing control instructions based on acceptable risk ofprocess disruption or failure;

FIG. 5 is a diagrammatic representation of an ideal pump cycle, a knowndiagnostic for gas interference, and an observed pump cycle, the systemconducting a determination, by PGM, of the state of the cycle of thepump and the likelihood that the gas interference agent (FIG. 6, 6-3)should be invoked;

FIG. 6 is a flow diagram of optional and possible Diagnostic Agents thatcould be recruited upon the identification of any potential variation ordeviation from normal or predicted operation in a pump operation such asan external disturbance or a change in process conditions or parametersas determined by a Status Agent of FIG. 1-1, Agents for well parameters(FIG. 6-1), rod fatigue monitoring and gas interference (FIG. 6-2) beingshown, each Agent also able to select through a probabilisticdetermination which tests and known actors might be at play;

FIGS. 7A and 7B illustrate three-dimensional (3D) plots of the forces ona rod string over the entire cycle, the surface shown in FIG. 7A beingtypically colorized (FIG. 7B) to show the Goodman loading for eachsection of the rod string throughout the cycle enabling a user to easilyidentify where in the stroke the rod string is being overstressed;

FIG. 8 is a diagrammatic representation of a grouping of a variety ofnodes that could be used to represent values in the process, model andmetrics according to the pump embodiment of FIG. 1-2;

FIG. 9 illustrates the learning of a structure resulting from thecombining of first and second components to provide a causalProbabilistic Graphical Model;

FIG. 10 is a diagrammatic representation of a role of a Control Agent inevaluating, establishing risk of specified actions and recommendingappropriate control action based on diagnostic results (FIG. 10-1) andfurther input from Optimization and Diagnostic Agent(s) (FIG. 10-2) forpossible optimization opportunities prior to the precise control actionto be taken;

FIG. 11 is a diagrammatic representation of a possible configuration fora Probabilistic Graphical Network for the pump embodiment of FIG. 1,namely using probabilistic methods for determining causality andimplementing control actions given the means for control, risk andconsequences of the actions including objectives to optimize performancebalanced with considerations to opposing objectives; and

FIG. 12 is a hardware diagram illustrating an embodiment having severalcomponents for establishing real time monitoring, network communicationsand process control whether they be local, remote or a combinationthereof.

SUMMARY

There is provided an artificially intelligent model-based controller(AIMC) that undertakes an analytic validation of the results of aclassification by an intelligent agent and to combine that with otherobservations of process variables to establish, as deterministically, aspossible the diagnosis of the process state and its underlying causessuch that sufficient confidence in the process state exists so thatautomated control action can be taken with acceptable levels of risk.

In one aspect of the invention a system is provided controlling aprocess in response to data collected from a plurality of sensors, saidsystem comprising: a status agent for monitoring the status of thesystem based on data collected from the sensors; at least one diagnosticagent for diagnosing at least a portion of the system and collectingdiagnostic data from the sensors to identify deviation from normaloperation; a control agent for performing control actions to theprocess; and a supervisory manager coupling to the status agent, the atleast one diagnostic agent and the control agent. The supervisorymanager receives real time process data generated from the process;compares against a predictive objective function and/or a historicalmean and/or a predicted operational envelope and/or a predeterminedstatic function for establishing any deviation from normal operation;applies probabilistic modeling at the status agent for classifying thesource and likely cause of the deviation; prioritizes actuation of theat least one diagnostic agent related to causality of the deviation;modifies the probabilistic model of the status agent from the resultsfrom the at least one diagnostic agent; and applies a probabilisticmodel at a control agent for evaluating risk and recommendingappropriate control action to the process.

In another aspect of the invention, a method for controlling a processcomprises: receiving real time process data generated from the process;comparing against a predictive objective function and/or a historicalmean and/or a predicted operational envelope and/or a predeterminedstatic function for establishing any deviation from normal operation;applying probabilistic modeling at a status agent for classifying thesource and likely cause of the deviation; prioritizing actuation of atleast one or more diagnostic agents related to causality of thedeviation at a supervisory manager; communicating the results of thediagnostic agents to the supervisory manager; modifying theprobabilistic model of the status agent from the results from the one ormore diagnostic agents; and applying a probabilistic model at a controlagent for evaluating risk and recommending and initiating an appropriatecontrol action to the process.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

Embodiments taught herein utilize an artificially intelligentmodel-based controller (AIMC) to undertake an analytic validation of theresults of a classification by an intelligent agent and combine thatwith other observations of process variables to establish asdeterministically as possible the diagnosis of the process state and itsunderlying causes such that sufficient confidence in the process stateexists so automated control action can be taken with acceptable levelsof risk.

A collection of probabilistic methods and pattern recognition techniquesare utilized to provide a hybrid monitoring and control system thatincorporates stochastic understanding of the process with machinelearning techniques to make process control decisions under uncertaintyas deterministically as possible.

Embodiments of the system have incorporated Probabilistic GraphicalNetworks (PGN), such as Bayesian networks, and time series patternrecognition techniques and the like, to structure and evaluate theclassification and diagnosis of the current state of the process byutilizing process variables, states and the outcomes of tests includingrelevant analytical models of processes, process sub systems ordisturbances to validate the likelihood of the various classifications.

Applicant believes that the process model(s) should be accurately tunedto reflect current operating conditions for the embodiments describedherein to perform optimally. Thus, a similar methodology is applied tothe process model where normal process operation is observed andcompared to past observations to detect drift of process parameters.Process simulations or a statistical representation of process outputsresulting from process parameter drifts are compared against currentobservations and used to identify, validate and update changes to theprocess model(s).

Additionally, a process simulation can be utilized to map exhaustively,or selectively, the process response to process variables, their rangeof operation and potential deviations such that changes to a process canbe determined probabilistically and represented as a PGN, potentiallyvia machine learning techniques. When combined with historicalobservations of the process, parameter tuning or process optimization isenabled that is highly deterministic in nature without exhaustivesimulations and/or numerical methods in real time.

Using machine learning techniques, process responses such as energyconsumption or production output could be represented in a PGN and usedto provide guidance to a numerical optimization means. The guidancecould encompass identifying a compact range for the numerical search toconverge on an optimal solution for the operating parameters or in theevent of a process with high levels of certainty, provide the optimaloperating parameters directly to control. In an alternate embodiment,the process variables could be represented as Fourier series or otherapproximation means and a probabilistic mapping of the global responsesof the process could be generated as a function of these Fouriercoefficients. This provides a unique advantage over other optimizationmethods as it can greatly reduce the time required to determine a localor a global optimum for the process in real time.

The probabilistic mapping of the process could be computed in thebackground of a processor controlling the process or on a separateprocessor which could also utilize parallel computing methods to reducethe elapsed time, and generate the probability tables for theoptimization PGN.

Furthermore, the determination of a control action is based on adecision analysis that incorporates the cost and risk associated withthe possible decision choices including the risk of taking controlaction on an incorrect classification or observation.

At the core of the AIMC system is a network of Intelligent Agents (lAs)each performing a predetermined scope of analysis and managed by acentral AI Manager.

Embodiments described herein will be described generally and in thecontext of a sucker rod pump controller for oil wells for controllingand optimizing the operation thereof. Those of skill in the art willunderstand that AIMC systems, based upon the embodiments taught herein,are in no way limited only for controlling a sucker rod pump, but can becustomized for use in any number of different types of dynamic processesin a wide variety of industries.

Having reference to FIG. 1, an embodiment of a hierarchical structure ofan IA network is shown having several types of agents in the context ofcontrol and optimization of a sucker rod pump controller for oil wells.

One aspect of the AIMC system is the integration of single or multipleprocess models and model predictive control techniques in conjunctionwith multiple Intelligent Agents or agents (IAs). Each IA performs,directs and prioritizes specialized analysis, diagnosis and controldirection utilizing probabilistic reasoning methods such asprobabilistic graphical models or Bayesian Networks. The AI Managerinitiates and prioritizes the various IAs to optimize processorutilization, communicates the results of tests, diagnoses and controlrecommendations and facilitates the learning capability via updates tothe data and probability tables used by the PGNs or Bayesian Networksutilized by the various IAs.

Multiple applications of the system can be made to work collaboratively,such as in the case of an oil field, where each well would have an AIMCsystem which also shares knowledge and learning with other wells andwith higher level systems such as an intelligent field manager orSupervisory Control and Data Acquisition (SCADA) system. Even wells noon the same pad can benefit as the sell data, pump dynacards andpatterns can be normalized. The knowledge can be shared by updating theprobability tables within the PGNs; using the case histories of otherwells to train the PGNs at other wells using other machine learningtechniques, or through sharing of learned process parameters or patternsobserved in process data. The SCADA may also provide control directionbased on the data and knowledge the SCADA receives collectively from theindividual wells.

As previously noted, while the current implementation has been initiallyapplied to a sucker rod pump system and field of oil wells, it isrecognized that the technology could be applied to other processes wherea process model can be utilized to ensure the optimal operation of thesystem from a production, maintenance and economic viewpoint.

As computation capacity and programmability of most industrialcontrollers is typically too limited to implement modern AI techniques,a control platform incorporates a run-to-completion, event drivenoperating system with a non-blocking kernel that can prioritize themonitoring and control of time sensitive aspects of the control solutionwhile running multiple algorithms or threads incorporating artificialintelligence methods that may run synchronously or asynchronously with agiven process on a priority basis.

Embodiments implement a controller that is scalable such thatcomputation can be distributed to addition processors, whether local orremote on embedded or PC computation platforms.

Such as controller can further connect to existing or proprietarycontroller networks to access and monitor process data and performdiagnostic and optimization tasks. This enables the technology describedherein to be integrated into existing or custom engineered systems andOEM products. Alternatively the AIMC system can incorporate digital oranalog inputs (I/O) of its own in addition to accessing existingcontrollers or remote I/O modules. In one implementation, controldirection is provided to industrial controllers that provide monitoringof I/O and provide the basic control operation with independent safetyinterlocks and permissives that are typical of that process.

The resulting technology enables diagnostic methods similar to that ofautomated medical diagnostic tools. While equipment is operating, theIAs run in the background identifying equipment and process issues,performing tests and calculations to identify with acceptable certaintythe operational state of the system being monitored, the source(s) ofany deviations from normal operation or problems, the best course ofaction and implement the action and/or provide operational guidance tooperators, supervisors or other automated controllers.

The artificially intelligent model-based controller (AIMC) utilizes oneor more of a process model, historical process information and/orprocess-derived state machines to monitor a process. The AIMC furtheruses a collection of intelligent agents to identify process deviationsand disturbances, classify, determine and validate the nature orunderlying causality for the disturbances utilizing PGN such as BayesianNetworks that operate synchronously or asynchronously. The AIMCinitiates optimization routines and determines control directionutilizing risk assessment and decision analysis with PGN or BayesianNetworks. Operations of the AIMC are coordinated via a central AIManager that initiates and prioritizes the various agents.

Overview of Intelligent Agents (IAs)

Embodiments taught herein utilize a variety of IAs, including but notlimited to, the AI Manager, the SCADA Manager, Data and Modeling Agents,Status Agents, Diagnostic Agents, Model Tuning Agents, OptimizationAgents and Control Strategy Agents.

The basic structure of an IA is a statistical or probabilistic causalitymodel with supporting algorithms and software methods to enable updatesof the IA's probability tables, entry of states for node values in aProbabilistic Graphical Model (PGM) and execution of queries. Theseagents IA may include additional algorithms and methods such as suchpattern recognition, numerical methods to estimate process parameters oroptimize process operation as well as those to monitor, test andclassify observations. In an embodiment, the AIMC contains a causalitymodel which is a Probabilistic Graphical Model (PGM) in the form of aBayesian Net or undirected probabilistic network such as a Markov net,however there are other implementations of PGNs that could be used toperform these functions and are known to those skilled in the art.

A typical operation of an intelligent agent includes the following:

-   -   receiving incoming data;    -   if required use algorithms to further analyze the data;    -   update any probability tables;    -   calculate or solve statistical or probabilistic causality model;    -   determine whether a decision or direction has been reached;    -   if not, identify additional tests or data required;    -   report to AI Manager; and    -   wait for further instructions or data from AI Manager until a        resolution has been reached.

Depending on the process and the different diagnostic complexities,multiple IAs of each type of IA may be deployed. The activation andexecution of the IAs are controlled on a priority basis that isstatistically or probabilistically determined. Alternately, IAs may bebroken into separate or sub-agents to reduce their complexity and/orenhance their capabilities. For example, a data and modeling agent maybe split into a separate IA for managing and testing historical data anda separate IA for managing and testing real-time or streaming data. ADiagnostic Agent and its PGN may constructed in an object-orientedmanner wherein it comprised multiple sub-PGNs, each for a range ofpotential diagnoses, that can be run individually as separate agents oras part of a larger more encompassing PGN in a single agent. One exampleof multiple sub-agents under an encompassing agent is an object-orientedBayesian Network (OOBN). A PGN may be represented as a single node in alarger PGN network. The PGN can be run on its own or in conjunction withothers.

Implementation

Having reference to FIG. 2, a functional diagram of a Status Agentillustrates the interaction of the Status Agent with a Diagnostic Agentand a Parameter Tuning Agent. Further, FIG. 3 illustrates a timingdiagram for the embodiment of FIG. 1, being set forth in the context ofa cyclic pumping process.

A functional diagram of the Status Agent showing its interaction withthe Diagnostic and Parameter Tuning Agents is shown in FIG. 2. A timingdiagram for the implementation with a cyclic pumping process is shown inFIG. 3.

In summary, general application of the roles of the agents is similar tothat set forth in the context of an oil well pumpjack.

The system comprises comparing real time data to statistical and/orhistorical profiles of the process or a simulated profile of theprocess, taking into account operational variance and therebyidentifying deviations. The Status Agent tracks the progress and thespecific states of the process. Pattern recognition, drift from theoperational envelope, and metrics of the deviation are in a classifierto identify probable diagnostic agents to trigger including a parametertuning agent. The AI Manager triggers the appropriate diagnostic agentsand receives the results. Diagnostic Agents with causal process-specificPGNs identify probable causes for the deviation and their likelihood.

The AI Manager compares the probabilities of the various DiagnosticAgents and updates the Status Agent of the diagnosis of high certaintyor initiates additional tests if the level of uncertainty is too high todifferentiate a likely cause. The AI Manager may further initiate theModel Tuning agent based on the output of the diagnostic agents. Controlstrategy agents assess opportunity and/or risk of control action basedon the probability of one or more diagnoses and recommends a controlaction based on the opportunity/risk analysis. Further, Optimizationagents may be triggered prior to a control action being implemented tooptimize or determine the precise control action to be taken.

Detailed Agent Description

As previously noted, the IAs are described herein in the context of thesucker rod pump application. Other contexts are discussed later forillustrating variations in the context-specific behaviour of thespecified agents.

AI Manager

As shown in FIG. 4, the AI Manager handles priorities and triggers oneor more Diagnostic Agents, based upon observations and triggers whichare received from one or more Data & Modeling Agents and one or moreStatus Agents.

The process of the AI Manager is autonomous and asynchronous tocoordinate execution and operation of the different intelligent agents(lAs). The design and configuration of the AI can change depending uponthe industrial application or context for which it is being used, thesystem possibly requiring a different number and design of functionalagents, such as Diagnostic and Control Agents. The responsibilities andof the AI Manager include:

-   -   receives outputs from the one or more Status Agents, activates        the appropriate Agent(s), dynamically prioritizes the agents and        monitors results from the different agents.    -   tracks the status of all active Diagnostic Agents, Optimization        agents and Control Agents.    -   uses results received from the Diagnostic and Control Agents to        enable/disable/adjust the tests used by the Data & Modeling        Agent and the Status Agent.    -   oversees triggering and data transfer to different computational        threads, such as IAs, many of which may contain probabilistic        graphical models PGM, such as Bayesian Nets and/or other IAs.    -   uses inter-process messaging (non-embedded) or event triggering        (embedded).    -   manages self-learning operations of Bayesian Nets and updating        of Process Parameters

Further, in applications with distributed, independent processes, suchan oil field, the AI Manager at each individual well may network orcoordinate with other AI Managers at other wells to share learneddiagnoses or control strategies either directly or via a central SCADAmanager.

Supervisory Control and Data Acquisition (SCADA) Manager

Systems according to embodiments taught herein having a SCADA mayincorporate AI functionality of each system within its domain orincorporate additional methods or agents to monitor field scaleparameters and their effects at the individual well.

The SCADA Manager may utilize the probability tables or historical datafrom individual wells to update the probability tables of other wells orprovide these wells historical case information to enable the wells toutilize machine learning techniques to update their own probabilitytables.

Data & Modeling Agent

One role of the Data & Modelling agent is to monitor and track processinformation and to run process models based on the process informationfor use by other agents.

The Data & Modelling agent operates synchronously in real time, handlingincoming data by running to completion each time data is received orafter each completion of a cycle in a periodic process or batch process,and/or over longer periods/multiple cycles.

The Data & Modelling agent runs process model(s) and performs real timeanalysis and tests at each data sample and/or cycle as directed by AIManager which acts on the behalf of diagnostic or decision agents. Testsor algorithms that require computational periods longer than timeprovided between data samples may be initiated and run asynchronously.

The Data & Modelling agent also performs logging of historical data.

The Data & Modelling agent operates in real time, receiving andconditioning incoming data and polling lower priority data as required.It will run kinematic and dynamic models of the equipment and processesutilizing the received data to observe and estimate the actualperformance of the process. To this end, the Data & Modelling agent willgenerate and log performance references for comparison against incomingdata.

These references will include a static model of the performance of theprocess based on process parameters and established operating envelopes.

The references further includes a statistically generated mean referencewith standard deviations of key measured and derived process parametersbased on multiple process cycles which is intended in part to filter outprocess noise and external disturbances. The statistically generatedmean reference will be generated over multiple cycles, loggedperiodically, used for a limited period of time for comparison againstcurrent process performance and then replaced as newer references aregenerated as required or as process parameters change. Each loggedreference is stored for historical analysis.

The references also include a model-based predictive reference utilizingmeasured and derived process parameters which incorporates a dynamicprocess mode and may or may not include ideal or projected outputs. Thismodel will be compared and validated against incoming process data andwill also be logged and updated periodically like the statisticalreference.

In the case of reciprocating systems such as a pumpjack, the agentgenerates a surface and a downhole dynamometer card for each pump cycleusing the kinematic and dynamic models of the surface and downholeequipment with the incoming process data. Dynamometer cards representrod load as a function of rod position during the course of a singlepump cycle consisting of a complete upstroke followed by a completedownstroke. The actual values and shape of the card are then compared orcorrelated with the static, statistical and predictive models asrequired.

Additional process parameters may be monitored including, but notlimited to, tubing and casing pressures, measured or derived forces andparameters such as pump friction, pump fillage, fluid levels, rodstresses along the rod string or applied to various process equipmentcomponents, surface or downhole.

The potential to use visual information such as pictures or videos toidentify production and operational issues is also recognized. Forexample, video of the motion of a sucker rod pump could be useful toidentify mechanical issues such as belt slippage, leaking chemicals orbroken components that may not be as evident from solely monitoring ofprocess inputs. In other process such as boilers, thermal images may beutilized to identify and located hot or cool spots in a boiler tubenetwork. The agent will include algorithms for specific tests that mayberequested by the AI Manager for use by other agents. These tests will beperformed as data streams in and may be performed for all or part of acycle or performed once a given cycle has completed. Calculations forthe cyclic tests may be distributed between streamed data and thecompletion of the cycle to optimize processor utilization. Tests mayinclude comparisons of incoming data against static, reference and modelpredictive surface and downhole cards, process/equipment operatingenvelopes and safety limits.

The agent will primarily transmit measured/derived data and results oftests to the Status Agent or, if required, directly to the AI Manager.The agent will internally manage the periodic logging of historical dataand references. Agent specific tests and exception logging of data willoccur at the request of the AI Manager.

Typical observable conditions and configured information for a suckerrod application include: Pressure: Casing and Tubing, Fluid Level, Wellparameters and configuration: Measured and calculated, Rod StringCompletion Data, Fluid viscosity and makeup, Flow/No-Flow Detection,Vibration Sensing—Level, Motor Voltage, Current, Torque, Speed, RodLoading: static and dynamic, Stroke Reference Position, InterlockStatus.

Status Agent

The primary role of the Status agent is to identify any potentialvariation or deviation from normal or predicted operation occurring suchas an external disturbance or a change in process conditions orparameters.

-   -   Consists of a mechanism to detect deviation from normal, ideal        or predicted operation, a PGM based state model of the process,        an operational envelop analysis means and pattern recognition        means and a classifier to triggers the appropriate diagnostic        and Control Agents and a mechanism to update inherent PGMs via        machine learning techniques if required.    -   Monitors and identifies between the real-time data and        historical data, model predictions.    -   It identifies whether variations significantly deviate from        normal operation and initiates tests to identify potential        sources or categories of sources for the variation and sets the        priorities for investigation. This optimizes use of valuable and        limited computation capacity.    -   The Operational Envelope Analysis uses a statistical mean of the        process based on historical data that is periodically updated        and/or a predicted/ideal model of the process. Deviations from        the normal or ideal operations are identified and flagged as to        their severity.    -   The state of the process is tracked as it moves through its        operational cycle using a PGM based state model that utilizes        tests on real time data to probabilistically identify the        current operation state.    -   For example, in the sucker rod pump application, the downhole        pump cycles through a upstroke where the fluid load of the pump        is lifted by upward motion, the closing of a travelling valve        and the opening of a standing valve followed by the downward        motion of the pump, the opening of the travelling valve and the        closing of the standing valve. In addition to the states of the        valves, there are states of fluid and/or gas compression and        decompression. As the process moves through the different        states, the PGM determines the likelihood of each state based on        observations and tests results. The PGM could be a hidden Markov        model, Bayesian Net or like probabilistic graphical model. See        FIG. 5.    -   A pattern recognition mechanism is included. The preferred        implementation is a time series pattern recognition that        provides a probabilistic match of incoming data stream to known        patterns from a database to assist the process state tracking by        PGM. Euclidean, dynamic time warping and dynamic derivation time        warping are the preferred matching criteria for implementation        although many mechanisms exist. In addition, the pattern        recognition includes a classification mechanism that can        identify and classify recurrent patterns that are associated        with process deviations, store these patterns and track their        reoccurrence in conjunction with process variables to assist        with manual diagnosis or a diagnosis based on machine learning        techniques using the pattern and the data observations        associated with its occurrence.    -   Finally a classifier is used to identify and prioritize the        appropriate diagnostic agents and/or Control Agents to trigger.    -   Probability tables of PGMs and classifiers are updated as        diagnoses are confirmed and validated to improve performance

The Status Agent utilizes a probabilistic graphical model(s) (PGM) as aclassifier that compares process data against Process Model predictionsand/or statistical historical data to identify a deviation(s) frompredicted or normal operation.

Based on the nature of deviation, diagnostics or evaluation of specificprocess parameters may be triggered and prioritized in order to identifythe source and causality.

Notice of completion of tests and their results will be sent directly tothe AI Manager which will trigger and prioritize the appropriatediagnostic, optimization and Control Agents. For example, probabledeviations in the process model's parameters will trigger the activationof an intelligent tuning agent.

Results of the diagnostics test and confirmation of diagnoses by thevarious agents will be communicated to the Status Agent via the AIManager to further train the Status Agent. Priors for the Status Agentmay be set manually or derived from probabilities established by similarwells.

It is intended that hidden or latent variables/nodes will beincorporated into the Status agent to facilitate the identification ofmodes, dependencies, relationships or issues not contemplated in theoriginal design of the graphical probability networks deployed.

Initially the Status Agent would need to be iterative in nature,monitoring as process conditions persist or evolve from stroke tostroke. It would generate status conditions and alarms to be relayed tothe AI Manager which would facilitate diagnosis and courses of action.Deviations that persist after several strokes may increase theprobabilities of some conditions and thus a reallocation of processorcomputational priorities.

The Status Agent would need to be capable of recognizing changes toprocesses or well conditions that evolve on a gradual level over thecourse of hours, days or months requiring access to historical trendingof well conditions. It may be determined that the Status Agent may bedivided into two separate agents to address short and longer termprocess variations.

It is also recognized that this agent may be reduced in scope to excludegenerating alarm for some system statuses that are better left todeterministic or logic type control.

The presence or absence of control action to remedy a known deviationmay be incorporated into the Bayesian Net as resolving the conditionwhich may take several strokes or more and generate additional processvariations.

Diagnostic Agents

A role of the Status agent is to identify any potential variation ordeviation from normal or predicted operation occurring such as anexternal disturbance or a change in process conditions or parameters.See FIG. 6.

-   -   Diagnoses causality of variation from normal operation or MPC.        Operates asynchronously after being triggered    -   Employs a PGM that identifies the probable condition of the        equipment and/or the causality for the deviation based on tests        and known data.    -   May request test(s) by data & modeling agent via AI Manager.    -   Outcomes from the diagnostic agent may be used to trigger        additional agents such as the model tuning agents that will        identify and quantify variations in process parameters.

In a preferred Diagnostic Agent implementation, a causal PGM model withthree main levels or categories of nodes would be used that sharefeatures found in clinical diagnoses.

Top level nodes are comprised of process parameters, independent orambient conditions, states of the process that can be observed (directlymeasured or applied to the process) or are known with relativecertainty. (Predispositions)

Mid-level nodes are the conditions that are potential diagnoses for theunderlying conditions that are contributing to the deviations in theprocess.

(Diseases)

Bottom level nodes are results of tests, observables, symptoms ormetrics which are dependent on the underlying conditions from whichtheir inherent probabilities are used to identify the underlyingconditions with an acceptable degree of certainty. (Diagnostic Tests,Symptoms)

Diagnostic Agent Example: Process Deviations Due to ExternalDisturbances: Gas Interference

As shown in FIGS. 5 and 6, a Diagnostic Agent is requisitioned orinitiated to apply a gas interference model, to validate and quantifythe condition and to facilitate updates or adjustments to the modelpredicative control.

Tests applied in the model will include pattern recognition of gasinterference in the downhole load position profile, whether or notsufficient load has been dropped to account for fluid loads andfriction, rate of change of loads with respect to position and time,whether timing, positions and rate of change of loads are consistentwith models of gas and fluid compression given the other observeddeviations in the downhole pump loads and potentially the rod loading atthe surface. In FIG. 5, the various dynamometer are shown, the variousstages of the operation being identifies by: PPRL—Peak Polish Rod Load,MPRL—Minimum Polish Rod Load, CBE—Counterbalance Effect, TV—TravellingValve, SV—Standing Valve, and numerical process points identifying:1—Start of DH Upstroke, 2—Fluid Load Picked up, SV open, TV closed,3—Top of DH Stroke/Start of DH Downstroke, 4—Fluid Load Being Dropped,TV & SV Closed, 5—Gas and Fluid Compression complete, SV open, 6—Gascompression in progress, TV & SV Closed, Pump Fillage identifiable,7—Fluid Load Picked up, TV open, SV Closed, 8—Pump plunger hitting topof pump, and 9—Pump plunger hitting bottom of pump. A sample deviationrelated to gas interference is shown in dotted lines.

Significant gas interference can result in fluid pound which stressesthe rod string and equipment or be indicative of a gas lock or pumpoffcondition necessitating a shutoff of the equipment to allow fluid levelsin the well to rise sufficiently for pumping to resume. Diagnostic agentmay trigger yet another separate Diagnostic agent to assess thecontributions to equipment fatigue.

The probability of the diagnosis will be compared by the AI Manager toassess the likelihood of a correct diagnosis based on the results ofindependent diagnoses for other conditions.

Diagnostic Agent Example: Fatigue Monitoring

Further, as required by the AI Manager, a further Diagnostic agent forFatigue monitoring can be recruited that monitors, assesses and tracksrod string equipment fatigue.

Forces applied to the rod during operation are calculated by thedownhole model and resolved to fixed segments of the rod string. Thestress and fatigue resulting from these forces is quantified andtracked. Goodman Analysis methods are used to assess how the stressesapplied in each stroke impacts the fatigue and life cycle of the rodstring. FIGS. 7A and 3B shows a three-dimensional plot of the stress andfatigue loads on the rod string over the entire cycle. The surface istypically colorized to show the Goodman loading for each section of therod string throughout the cycle enabling a user to easily identify wherein the stroke the rod string is being overstressed.

Likelihood of damage to the rod string in the short and long term isassessed including its impact on the mean time between failures (MTBF)for the equipment.

Unacceptable levels of stress are flagged or alarmed and returned to theAI and Alarm managers so that specific control action may be determinedand implemented.

Process Model Parameter Tuning Example: Well Parameter Tuning Agent forDownhole Observer Model of Sucker Rod Pump

The Process Model is “self-tuning” or learning. This is outside of thefailure of an equipment or external disturbance which are intended beaddressed with specialized intelligent agent(s) (IA) of their own.

A role of the Process Model Parameter Tuning Agent is to ensure that theprocess model(s) accurately reflect the actual process. Triggered by theStatus agent and Diagnostic Agents, the Tuning Agent identifies,evaluates and quantifies potential variations in model parameters,process variables and equipment condition that contribute to deviationsbetween the process and the process model.

As changes in well conditions persist from stroke to stroke or evolve ona gradual level, there is a need to ensure that process model(s) remainaccurate. Probable deviations in the process model's parameters willtrigger the activation of the Tuning Agent.

The Tuning Agent:

Employs a PGM that identifies the probable variations of processparameters and/or equipment condition that contribute to the processmodel based on tests and known data.

Using the probabilities for process parameter variation, the modeltuning agent can initiate and prioritize numerical or iterative methodswith the process model to identify and quantify the possiblecontributions to the observed deviations and validate them againstcurrent data observed from the process. Once the potential sources arequantified, the probability of the variations required to correct theprocess model are probabilistically considered using a decision net thattakes into account the risk associated with incorrect diagnoses.

Specific metrics, tests or measurements that are outside of regularoperation may be necessary to assist in the diagnosis and tuning of theprocess model(s) and would be performed on an as needed basis; however,once “tuned”, the need for these tests should be minimized so as not toadversely affect production or consume limited computing capacity.

Basic Concept of Operation

Using historical sequence of mean, average, or typical process cycles,the Process Model Tuning Agent identifies the most likely causes for theobserved deviations in the historical sequence, and validates the causeand corrects the parameters in the model.

In the case of the sucker rod pump/oil well, many different parameterchanges or conditions can contribute to a process deviation.

Well conditions can change very quickly from one stroke to the next asin the case of a failure of mechanical systems, pumpoff or gas lock,sticking of the rod string, etc. These may need to be identified andflagged for alarming, change of control mode or action depending on thenature of the condition. Other conditions can be measured such as gaspressure, temperature, pump speed, rod loading, etc.

Process Model parameters change more gradually but also can be affectedby well conditions as they change. For example, a leak in the tubing canaffect fluid levels and pressure in the tubing.

Some of these well conditions can affect multiple parameters. Forexample, temperature can affect fluid viscosity and cause wax toprecipitate increasing friction. Fluid level can affect downholepressure and buoyant rod weight affecting friction, viscosity and otherobserved forces.

Some parameters change slowly over hours or days versus from stroke tostroke. The agent would need to assess the rate of change of parametersand targeting those most likely to influence the observed error over thetime observed for it to manifest.

The scope of operation of the agent would ideally be limited to thetuning of the downhole model and but also capable of identifying achange that is beyond that scope (independent of the model) such asequipment failure or some external disturbances. The IA would thendirect other agents, algorithms, control modes or alarm managers toengage to resolve the deviation in the process from the model.

To tune the model, it may be advantageous to have an IA providedirection as to which parameters and the range of values for thoseparameters so that an algorithm may more expeditiously search forcorrective values rather than a global search. It may also assist inidentifying whether one or more parameters need adjustment.

Agent Implementation

The Process Model Tuning agent would compare historical records of theprocess with the current record, taking the current measured values ofprocess variables and derived process metrics to identify and validatewhich model parameter(s) have varied and determine the corrected values.

In the case of the pumpjack, there are significant variations from onedynamometer card to the next which may mask changes in Process Modelparameters. To overcome this, multiple dynamometer cards would be usedto generate a distribution of which the mean and variance/standarddeviation would be saved on a periodic basis in the form of a FastFourier Transform (FFT). A historical “mean” card be compared to themost recent mean or the current output of the Process Model to identifyshifts in the metrics.

In a preferred IA implementation, a causal PGM model with three mainlevels or categories of nodes would be used in a manner similar to thatused in a diagnostic agent.

Top level nodes are comprised of process parameters, independent orambient conditions that can be observed (directly measured or applied tothe process) or are known with relative certainty and can influence thelikelihood a parameter has changed. (Predispositions)

Mid-level nodes are the Process Model parameters that cannot be directlymeasured with certainty and are subject to variation. (Diseases)

Bottom level nodes are observables, symptoms or metrics which aredependent on the model and well conditions or the outcome of tests thatcan be applied to further resolve the Process Model parameters and rangeof variations. (Diagnostic Tests, Symptoms)

FIG. 8 shows a grouping of the various nodes that could be used torepresent the values in the process, model and metrics.

The probabilistic graphical model for the agent comprises two maincomponents: a mapping of the possible range of process metrics andprobability tables of the likelihood that the process model parameterhas changed.

The first component is a mapping of the possible range of processmetrics that would result from the range of process variables andprocess model parameters. This mapping may be of absolute values ordeviations from nominal values for variables or parameters as required.In essence for a given instance or range of process variables and aspecific instance of the model parameters and the metrics would bedetermined based on the model. It is possible that some or all of thevariables, parameters or metrics could be represented as discrete rangesor continuous distributions and determined through an exhaustiveiteration of the model for all values. Alternatively, the mapping couldbe based on the causality between the various variables and processmodel as opposed to a dependencies completely derived via machinelearning and exhaustive simulation of the process over the range ofpossible variables and parameters.

The second component includes probability table(s) or distribution(s) ofthe likelihood that the process model parameter has changed since thelast historical record was taken. This could be based on historical databut also include calculations. One example of a calculation would be thelikelihood of a fluid level change based on the possible range of fluidvolume produced given the time between current and historical records.

With reference to FIG. 9 that illustrating a process model learnedsensitivity with a learned structure, mapping and likelihood of changeare combined and learning the structure provides a causal ProbabilisticGraphical Model (PGM).

For a given set of process variables and metrics, the PGM identifies themost probable model parameter to have changed and trigger specificnumerical methods to derive the exact values required to correctly tunethe model. The PGM and associated “tuning” algorithms are able tooperate in situations where multiple model parameters may have changed.This may involve iterating the predictive model with actual orhistorical results to converge on revised process parameters.

It is also possible that the agents would initiate or requestsupplemental tests so that the source of the deviations can be diagnosedand validated.

The goal is to efficiently and automatically tune the model as theprocess is running in the background. The IA may also utilize real timedata as part of the effort to validate the tuning before locking in therevised parameters. The specific process parameter(s) that have changedwould be quantified and validated using the process model(s) and realtime data and referred to the AI Manager for updating process parameterand probability tables for all related IAs.

The agent described herein is not intended to be directly in the controlloop. It may also act as resource manager to queue other agents toinitiate an investigation into higher level well operations andconditions by determining the source of deviations is not likely to berelated to variation in the process model parameters.

In the case of the pumpjack, operation, using a variable intra-strokespeed may require a different PGM than that of the fixed intra-strokespeed as the variation of the speed adds significant complexity and cangreatly affect the metrics and learned structure to identify and correctprocess model parameters. This increased complexity also greatlyincreases the degree to which the process can be optimized and the valueadded of the overall method and apparatus.

Model Configuration

Certain data pertaining to the well “completion” is known. That beingsaid, in the course of operation, the initial model will be validatedagainst the configuration information provided. This would pertain tothe type of equipment installed and its specific configuration. Theconfiguration information is likely to change during operation. Suchinformation in the cyclic pump controller context includes:

-   -   Rod string types, lengths, properties and placements within        overall rod string    -   Pumpjack type, geometry, gear ratios, operating limits    -   Downhole pump, type, dimensions, operating limits, other info    -   Tubing type and anchors    -   Orientation and deflections of well as drilled    -   Other equipment downhole or on the surface that could impact        dynamic model performance    -   Rod scrappers, Spacers, and the like    -   Process Variables    -   Process variable can include but may not be limited to:    -   Pump speed and position    -   Gas pressure in the casing and in the tubing    -   Temperature(s) at surface: ambient, flowline    -   Actual Production.

Process Model Parameters

There will be information on the fluid being produced. These values maychange gradually with time and production rates.

-   -   Fluid Level in the casing and in the tubing    -   Fluid Density, Viscosity (static and dynamic)

These values will change with depth/pressure, temperature, % of oil,water gas or other fluids (i.e. water cut).

Process Metrics

There will be other information on the status of the well and downholeconditions. Some of this information can be measured, calculated orinferred/approximated based on the information on well configuration,direct measurements or other conditions in if known.

-   -   Surface and Downhole load measurements with respect to time        and/or position in the pump stroke    -   Temperature downhole and gradient to the surface    -   Static rod loads downhole and gradient to the surface    -   Relative and absolute contributions of Fluid weight, friction,        etc to surface and downhole card, and    -   Operator input or manual tests may be requested.

Control Agents

The primary role of a Control Agent is to evaluate & recommendsappropriate control action based on diagnostic results and input fromOptimization and Diagnostic Agent(s). It typically uses using aprobabilistic decision net that takes into account the risk associatedwith control action. See FIG. 10.

Control Agent Example: Pumpoff Agent for Downhole Observer Model ofSucker Rod Pump

The Control Agent monitors and identifies variations from normaloperation & recommends appropriate control action based on informationfrom Diagnostic Agents and other Agent(s). Actions may include Off/Ondirection or adjustment of pumpoff cycle parameters such as the on andoff durations.

For example, gas interference may result in some fluid pound that may ornot be within allowable rod stress limits. The Fatigue Monitoring Agentwill quantify the fatigue being experienced by the rod string and itsimpact on the MTBF. The persistence of the conditions, the severity andexternal conditions may dictate singular or multiple courses of actions.In the event of multiple courses of action or condition that have notbeen previously encountered, the Control Agent may trigger anOptimization Agent to access and recommend the best strategy.

The severity of the fatigue, probability of failure, cost of repair,control options to reduce fatigue and the opportunity cost of lostproduction or the value of increased production would factored into aPGN decision net based on risk and opportunity to evaluate the course ofaction. A possible configuration for a PGN is shown in FIG. 11. Thisagent integrates the results of the various Diagnostic Agents and makecontrol direction decisions. It may also alert the operator to designissues or potential mitigants such as reducing the pumping speed. TheControl Agent is a learning agent for learning the best control actionfor various conditions from the recommendation of Optimization Agentsand the success of earlier recommendations.

Optimization Agents

A role of an Optimization agent is to use models and calculatedparameters to evaluate potential optimization strategies and provideguidance. The Agent typically uses a probabilistic decision net thattakes into account opportunity or the risk associated with differentoptimization strategies action.

Additionally, a process simulation can be utilized to map exhaustively,or selectively, the process response to process variables, their rangeof operation and potential deviations such that changes to a process canbe determined probabilistically and represented as PGN, potentially viamachine learning techniques. When combined with historical observationsof the process, this enables a means of process optimization that ishighly deterministic in nature without exhaustive simulations and/ornumerical methods in real time.

Using machine learning techniques, process responses such as energyconsumption or production output could be represented in a PGN and usedto provide guidance to a numerical optimization means. The guidancecould encompass identifying a compact range for the numerical search toconverge on an optimal solution for the operating parameters or in theevent of a process with high levels of certainty, provide the optimaloperating parameters directly to control. In an alternate embodiment,the process variables could be represented as Fourier series or otherapproximation means and a probabilistic mapping of the global responsesof the process could be generated as a function of these Fouriercoefficients. This provides a unique advantage over other optimizationmethods as it can greatly reduce the time required to determine a localor a global optimum for the process in real time.

The probabilistic mapping of the process could be computed in thebackground of a processor controlling the process or on a separateprocessor which could also utilize parallel computing methods to reducethe elapsed time, and generate the probability tables for theoptimization PGN.

In the case of oil well pumping system, local or global optimizations ofcomplex intrastroke variations of pump prime mover speed to optimize thewell such as those of U.S. Pat. No. 6,890,156 to Watson (pumpjack speedprofiling) could be performed with significantly reduced computationcompared to other numerical optimization means.

-   -   Uses process models and calculated parameters in conjunction        with numerical or iterative methods to evaluate potential        optimization strategies and provide guidance. Operates        asynchronously after being triggered.    -   For example, in the sucker rod pump application controlled by a        fixed speed motor, the agent may use statistical or cumulative        pump fillage and run time to establish well inflow rates and        utilize these to determine optimal pump on and off cycles to        maximize production based on acceptable fatigue limits to the        sucker rod string and/or provide guidance for setting the        optimal strokes per minute to operate the pump. It may identify        situations where a control strategy such as PumpOff may or may        not be used based on multiple conditions including but limited        to production and energy requirements, energy savings, fatigue,        external temperatures that may impact performance such as        freezing of lines during winter, etc.    -   In a sucker rod pump application where the motor speed is        variable over multiple cycles via a variable speed or variable        frequency drive it may direct the Control Agent to vary the        speed of the drive.    -   In a sucker rod pump application where the motor speed is        variable within the stroke such as that of (Watson U.S. Pat. No.        6,890,156), different speed profiles may be determined based on        the process model, predetermined speed profiles initiated or        adjusted and provided to the Control Agent for implementation.

Pumpjack Controller—Embodiment

With reference to FIG. 12, an embodiment of a pumpjack controller isshown. FIG. 12 illustrates the hardware structure of the system 1200disclosed herein, according to one embodiment. As shown, the system 1200comprises a controller 1202 installed on the jobsite of an oil well. Thecontroller 1202 may be implemented in a general purpose computerprogrammed with appropriate software, firmware, a microcontroller, amicroprocessor or a plurality of microprocessors, a digital signalprocessor or other hardware or combination of hardware and softwareknown to those skilled in the art.

The controller 1202 communicates with a plurality of sensors 1204installed on various devices such as the pumpjack, tubing string,casing, sucker rod and the like, on the ground or in the wellbore, forcollecting data regarding the oil well and devices, e.g., crank speed,rod stress, downhole temperature and pressure, fluid level and the like.Those skilled in the art appreciate that it is dependent on the systemdesign and implementation to determine what sensors are required in thesystem and what data to be collected.

The controller 1202 also communicates with a plurality of action devices1206 such as variable speed motors, AC or DC variable speed drive suchas an ABE ACS-601 (ABE Industry Oy, Helsinki, Finland) or Allen-Bradley1336 Impact drive (Rockwell Automation, Milwaukee, Wis., USA), dynamicbrake, alarm, and the like, for controlling the operation of devices ofthe oil well, in accordance with predefined rules, e.g., a crank speedprofile for controlling crank speed, and/or in response to datacollected from sensors 1204.

The system 1200 further comprises one or more computing devices 1210. Asthose skilled in the art appreciate, each computing device 1210 maycomprise a processor, a storage such as Read-Only Memory (ROM), volatileand/or non-volatile Random Access Memory (RAM), solid state drive, harddrive, or the like, a network module, and other components, allconnected to the processor via one or more signal buses. Each computingdevice 1210 executes an operating system, e.g., a real-time operatingsystem, Unix®, Linux®, Microsoft® Window NT, Microsoft® Windows 2000Server, Microsoft® Windows Server 2012 or the like. Generally, anoperating system is a set of computer readable code executed by theprocessor for managing various hardware and software components, and forsupporting the execution of application programs.

Some computing devices 1210 may be deployed in the jobsite of the oilwell and connect to the controller via proper wired or wireless meanssuch as direct cable connection, a local area network (LAN), Ethernet,WiFi®, Bluetooth®, Zigbee®, or the like. Some computing devices 1210 maybe deployed remote to the oil well, and are connected to the controllerthrough a wide area network (WAN), the Internet, a telephone network, acable network or satellite, via proper wired or wireless means. Thoseskilled in the art appreciate that, depending on the system design andimplementation, the one or more computing devices 1210 may be desktopcomputers, laptops, server computers, tablets, smart phones, or thelike. As those skilled in the art appreciate, the software disclosedherein may be deployed on one or more computing device 1210, and theprocessing load may also be dynamically distributed among at least someof the processors of the controller 1202 and/or computing devices 1210.

Other embodiments comprise: a system for controlling a processcomprising: at least one processor; at least one sensor coupled to theat least one processor; and a storage coupled with and readable by theat least one processor and storing a set of instructions which, whenexecuted by the at least one processor, cause the processor to performactions comprising: receiving, from the at least one sensor, real timeprocess data generated by the process; comparing against a predictiveobjective function and/or a historical mean and/or a predictedoperational envelope and/or a predetermined static function forestablishing any deviation from normal operation; applying probabilisticmodeling at a status agent for classifying the source and likely causeof the deviation; prioritizing actuation of at least one or morediagnostic agents related to causality of the deviation at a supervisorymanager; communicating the results of the diagnostic agents to thesupervisory manager; modifying the probabilistic model of the statusagent from the results from the one or more diagnostic agents; andapplying a probabilistic model at a control agent for evaluating riskand recommending appropriate control action to the process.

In another embodiment, a computer-readable storage device is providedcomprising computer-executable instructions for controlling a process,wherein the instructions, when executed, cause a processor to performactions comprising: receiving, from the at least one sensor, real timeprocess data generated by the process; comparing against a predictiveobjective function and/or a historical mean and/or a predictedoperational envelope and/or a predetermined static function forestablishing any deviation from normal operation; applying probabilisticmodeling at a status agent for classifying the source and likely causeof the deviation; prioritizing actuation of at least one or morediagnostic agents related to causality of the deviation at a supervisorymanager; communicating the results of the diagnostic agents to thesupervisory manager; modifying the probabilistic model of the statusagent from the results from the one or more diagnostic agents; andapplying a probabilistic model at a control agent for evaluating riskand recommending appropriate control action to the process.

Other Applications

The system and methodology described herein, both generally and in thespecific context of a pumpjack, are also applicable to a wide variety ofother processed including: Steam Methane Reformer, Boiler, HeatTreatment Furnace, Water Treatment, and Compressor Skid/System.

In some additional detail for a couple of other scenarios, the nature ofsuch other processes and the role of the Agents is described as follows.

Model Predictive Controller

Model predictive control techniques typically require the nature ofdisturbances to be known in advance in order to provide controldirection to bring the process back within its normal operatingenvelope. They also require the parameters of the model to be accuratelytuned such that inputs to the model generate accurate and relevantoutputs. Such applications require significant upkeep by highly skilledand knowledgeable individuals unless they are highly stable. In a batchprocess application with a model predictive controller, the rolesimplemented for the agents is similar roles to that in the oil wellpumpjack application except that control action is more limited as it isrelegated to the model predictive controller. The roles of the Agentsinclude The Data and Modeling Agent, the Status Agent, AI Manager,various Diagnostic Agents wherein the AI Manager will compares theprobabilities of the various Diagnostic Agents and updates the StatusAgent of the diagnosis of high certainty or initiated additional testsif the level of uncertainty is too high to differentiate a likely cause.The AI Manager may also initiate the Model Tuning agent based on theoutput of the diagnostic agents.

The Control Agent assesses opportunity and/or risk based on theprobability of one or more diagnosis and recommends a change of model orcontrol action to the model predictive controller based on theopportunity/risk analysis.

Compressor Skid/System

Compressor skids are representative of a typical packaged system that isdesigned to perform a task of a narrow range, in this case thecompression of gases to feed into a process or the compression of gasestaken from a process to maintain a vacuum. The later can be found on oilwells where the casing pressure is reduced below atmospheric pressure toincrease well inflow.

These applications are typical fluid and thermodynamic process where thepumps, valves and process operation are sized for a specific operationand readily modelled. Equipment failure, process disturbances andoperational limits account for much of the variation in the process.

Again the roles are very similar to that of the oil well pumpjackapplication, with the primary change being the process model, theoperational states tracked by the Status Agent and the nature ofDiagnostic Agents which are process specific. In this case, monitoringthe commanded versus actual pressures, flow and temperature of theprocess to establish probabilities. Depending on the risk and safetyimplications, the controller may be utilized to conduct actual tests bymaking small changes to process setpoints and verifying the disturbancesand resulting control actions are indicative of proper operation tofurther isolate the source of process disturbances.

The process the skid is controlling may also be modelled enabling abroader range of scope for the AIMC.

Other Process Systems

The application into other processes, such as furnaces, or boilers,compressors or a collection of processes which are combined into complexsystems such as steam reformers or refineries; do not fundamentallychange how basic operation of the AIMC and its agents. As the system isdesigned to operate under uncertain conditions, the scope of controlaction may be restricted based on the safety and risk tolerance. Much ofthis can be handled by the preferred implementation which is to have theAIMC make control recommendations to a standard industrial controllerwhich incorporates the necessary safety interlocks and permissives toensure safe operation in all circumstances.

The embodiments of the invention for which an exclusive property orprivilege is claimed are defined as follows:
 1. A method for controllinga process comprising: receiving real time process data generated fromthe process; comparing against a predictive objective function and/or ahistorical mean and/or a predicted operational envelope and/or apredetermined static function for establishing any deviation from normaloperation; applying probabilistic modeling at a status agent forclassifying the source and likely cause of the deviation; prioritizingactuation of at least one or more diagnostic agents related to causalityof the deviation at a supervisory manager; communicating the results ofthe diagnostic agents to the supervisory manager; modifying theprobabilistic model of the status agent from the results from the one ormore diagnostic agents; and applying a probabilistic model at a controlagent for evaluating risk and recommending and initiating an appropriatecontrol action to the process.
 2. A method of controlling a processcomprising: comparing real time data to statistical and/or historicalprofiles of the process or a simulated profile of the process, takinginto account operational variance and thereby identifying deviations;tracking the progress and the specific states of the process at a statusagent and classifying probable diagnostic agents relevant to thedeviations; and under the management of an AI Manager, triggering theappropriate diagnostic agents with causal process-specific PGNs foridentifying probable causes for the deviation and their likelihood, andreceiving the probabilistic diagnoses; comparing the probabilisticdiagnoses of the various diagnostic agents and updating the Status Agentof the diagnosis of high certainty, or if sufficiently uncertain todifferentiate a likely cause, initiating additional tests; and assessingopportunity and/or risk of control action at a control agent based onthe probability of one or more diagnoses and recommending a controlaction to the process based on the opportunity/risk analysis.
 3. Asystem for controlling a process in response to data collected from aplurality of sensors, said system comprising: a status agent formonitoring the status of the system based on data collected from thesensors; at least one diagnostic agent for diagnosing at least a portionof the system and collecting diagnostic data from the sensors toidentify deviation from normal operation; a control agent for performingcontrol actions to the process; and a supervisory manager coupling tothe status agent, the at least one diagnostic agent and the controlagent for: receiving real time process data generated from the process;comparing against a predictive objective function and/or a historicalmean and/or a predicted operational envelope and/or a predeterminedstatic function for establishing any deviation from normal operation;applying probabilistic modeling at the status agent for classifying thesource and likely cause of the deviation; prioritizing actuation of theat least one diagnostic agent related to causality of the deviation;modifying the probabilistic model of the status agent from the resultsfrom the at least one diagnostic agent; and applying a probabilisticmodel at a control agent for evaluating risk and recommendingappropriate control action to the process.